package com.wechatpay.v3.vo;

import com.wechatpay.v3.enums.WechatPayType;

import java.io.Serializable;
import java.math.BigDecimal;

/**
 * 微信支付统一下单 - 请求数据封装
 *
 * @author liuyi <liuy@pvc123.com>
 * @since 2021/8/2
 */
public class UnifiedOrderVo implements Serializable {

    /** 关联应用id，不填则取配置文件的值 */
    private String appId;
    /** 用户关联的openId, 非必填，扫码支付、app支付非必填 */
    private String openId;
    /** 支付类型，0 jsapi,1 app, 2 h5, 3 native */
    private int payType;
    /** 支付金额，单位元，货种固定为人民币(CNY) */
    private BigDecimal total;
    /** 商户交易单号，需保证同一个mchId下的单号唯一 */
    private String tradeNo;
    /** 商品描述 */
    private String description;
    /** 支付成功回调，不填则取配置文件的值；必须为直接可访问的URL，不允许携带查询串，要求必须为https地址 */
    private String notifyUrl;
    /** 自定义附加数据，回调和查询的时候原样返回 */
    private String attach;

    public String getAppId() {
        return appId;
    }

    public void setAppId(String appId) {
        this.appId = appId;
    }

    public String getOpenId() {
        return openId;
    }

    public void setOpenId(String openId) {
        this.openId = openId;
    }

    public int getPayType() {
        return payType;
    }

    public void setPayType(WechatPayType payType) {
        this.payType = payType.key;
    }

    public BigDecimal getTotal() {
        return total;
    }

    public void setTotal(BigDecimal total) {
        this.total = total;
    }

    public String getTradeNo() {
        return tradeNo;
    }

    public void setTradeNo(String tradeNo) {
        this.tradeNo = tradeNo;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getNotifyUrl() {
        return notifyUrl;
    }

    public void setNotifyUrl(String notifyUrl) {
        this.notifyUrl = notifyUrl;
    }

    public String getAttach() {
        return attach;
    }

    public void setAttach(String attach) {
        this.attach = attach;
    }
}
